﻿/*----------------------------------------------------------------
//  <copyright file="SmsOptions.cs" company="MicroCloud@151504200868">
//      Copyright © 2020-2024 MicroCloud Corporation, All rights reserved.
//  </copyright>
//  <site>https://gitee.com/chenmm123/microclouds</site>
//  <last-editor>cmm</last-editor>
//  <last-date>2023-09-14 11:20</last-date>
//----------------------------------------------------------------*/

namespace MicroCloud.SMS.Options
{
    #region "短信配置选项"
    /// <summary>
    /// 短信配置选项
    /// </summary>
    public class SmsOptions
    {
        #region "属性"
        #region "获取或设置 短信服务提供商"
        /// <summary>
        /// 获取或设置 短信服务提供商
        /// <para>"Aliyun"-阿里云、"YFXYT"-逸峰信盈通</para>
        /// </summary>
        public string Provider { get; set; }
        #endregion
        #region "获取或设置 服务商授权ID"
        /// <summary>
        /// 获取或设置 服务商授权ID
        /// <para>联系服务商获取</para>
        /// </summary>
        public string Id { get; set; }
        #endregion
        #region "获取或设置 服务商授权密钥"
        /// <summary>
        /// 获取或设置 服务商授权密钥
        /// <para>联系服务商获取</para>
        /// </summary>
        public string Secret { get; set; }
        #endregion
        #region "获取或设置 短信签名名称"
        /// <summary>
        /// 获取或设置 短信签名名称
        /// <para>联系服务商设置并获取</para>
        /// </summary>
        public string SignName { get; set; }
        #endregion
        #region "获取或设置 验证码短信模板"
        /// <summary>
        /// 获取或设置 验证码短信模板
        /// <para>联系服务商设置并获取(逸峰信盈通不需要)</para>
        /// </summary>
        public string VerifyCodeTemplate { get; set; }
        #endregion
        #region "获取或设置 验证码短信模板参数"
        /// <summary>
        /// 获取或设置 验证码短信模板参数
        /// <para>联系服务商设置并获取(逸峰信盈通不需要)</para>
        /// </summary>
        public string VerifyCodeTempParam { get; set; }
        #endregion
        #region "获取或设置 验证码短信内容"
        /// <summary>
        /// 获取或设置 验证码短信内容
        /// <para>{0} 表示为验证码内容，{1} 表示为有效分钟数</para>
        /// </summary>
        public string VerifyCodeSMS { get; set; }
        #endregion
        #region "获取或设置 通知短信模板"
        /// <summary>
        /// 获取或设置 通知短信模板
        /// </summary>
        public string NoticeTemplate { get; set; }
        #endregion
        #region "获取或设置 通知短信模板参数"
        /// <summary>
        /// 获取或设置 通知短信模板参数
        /// </summary>
        public string NoticeTempParam { get; set; }
        #endregion
        #region "获取或设置 推广短信模板"
        /// <summary>
        /// 获取或设置 推广短信模板
        /// </summary>
        public string PromoteTemplate { get; set; }
        #endregion
        #region "获取或设置 验证码有效期分钟数(1-1440)"
        /// <summary>
        /// 获取或设置 验证码有效期分钟数(1-1440)
        /// <para>默认3</para>
        /// </summary>
        public decimal VerifyCodeExpireMins { get; set; } = 3;
        #endregion
        #region "获取或设置 1个自然日内短信发送条数限制(0表示不限制)"
        /// <summary>
        /// 获取或设置 1个自然日内短信发送条数限制(0表示不限制)
        /// <para>默认0</para>
        /// </summary>
        public int LimitOfNumberDay { get; set; } = 0;
        #endregion
        #region "获取或设置 存储天数(0表示永久存储)"
        /// <summary>
        /// 获取或设置 存储天数(0表示永久存储)
        /// <para>默认0</para>
        /// </summary>
        public int StorageDays { get; set; } = 0;
        #endregion

        #region "获取 短信服务提供商枚举"
        private SmsProvider _ProviderEnum = SmsProvider.Aliyun;
        /// <summary>
        /// 获取 短信服务提供商枚举
        /// </summary>
        public SmsProvider ProviderEnum
        {
            get
            {
                switch (Provider.Trim().ToUpper())
                {
                    case "ALIYUN":
                        _ProviderEnum = SmsProvider.Aliyun;
                        break;
                    case "YFXYT":
                        _ProviderEnum = SmsProvider.YFXYT;
                        break;
                }

                return _ProviderEnum;
            }
        }
        #endregion
        #region "获取 产品名称"
        private string _Product = "";
        /// <summary>
        /// 获取 产品名称
        /// </summary>
        public string Product
        {
            get
            {
                switch (ProviderEnum)
                {
                    case SmsProvider.Aliyun:
                        _Product = AliyunConstants.Product;
                        break;
                    case SmsProvider.YFXYT:
                        _Product = JnyfConstants.Product;
                        break;
                }
                return _Product;
            }
        }
        #endregion
        #region "获取 产品域名"
        private string _Domain = "";
        /// <summary>
        /// 获取 产品域名
        /// </summary>
        public string Domain
        {
            get
            {
                switch (ProviderEnum)
                {
                    case SmsProvider.Aliyun:
                        _Domain = AliyunConstants.Domain;
                        break;
                    case SmsProvider.YFXYT:
                        _Domain = JnyfConstants.Domain;
                        break;
                }
                return _Domain;
            }
        }
        #endregion
        #region "获取 区域ID"
        private string _RegionId = "";
        /// <summary>
        /// 获取 区域ID
        /// </summary>
        public string RegionId
        {
            get
            {
                switch (ProviderEnum)
                {
                    case SmsProvider.Aliyun:
                        _RegionId = AliyunConstants.RegionId;
                        break;
                    case SmsProvider.YFXYT:
                        _RegionId = JnyfConstants.RegionId;
                        break;
                }
                return _RegionId;
            }
        }
        #endregion

        #endregion

    }
    #endregion

}
